<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../Vue.js"></script>
    <script src="./Axios.js"></script>
    <style>
        *{
            margin: 0;
            padding: 0;
            list-style: none;
        }
        img{
            width: 80px;
            height: 110px;
            float: left;
            padding-right:20px ;
        }
        li{
             padding: 5px;
             overflow: hidden;
        }
    </style>
</head>

<body> 
    <div class="div">
        <button @click="fetchs">点击</button>
        <ul>
            <template v-for="i in datelis">
                <li>
                    <img :src="i.img" alt="" srcset="">
                    <div style="font-size: 19px;font-weight: 900;">{{i.nm}}</div>
                    <div>
                        <div><span></span>观众评分:<span :style="style">{{i.sc}}</span></div>
                        <div>{{i.desc}}</div>
                        <div>{{i.showInfo}}</div>
                    </div>
                </li>
            </template>
        </ul>
    </div>
    <script>
        const obj = {
            data() {
                return {
                  datelis:[],
                  style:{
                    color: 'yellow',
                    'font-weight':'bold',
                    'margin-left': '5px',
                  }
                }
            },
           
            methods: {
                fetchs(){ 
                axios.get('./axiosjson.json')
                .then(res=>{
                     console.log(res.data.data.hot); 
                     this.datelis=res.data.data.hot 
                 }).catch(err=>{
                    console.log(err);
                 })

                //  axios.post('http://localhost:3000/data')
                // .then(res=>{
                //      console.log(res.data.hot); 
                //     //  this.datelis=res.data.hot 
                //  }) 
                 
                 
                }
            }
        }
        Vue.createApp(obj).mount('.div')
    </script>
</body>

</html>